package com.sh.rpc.confige;

import com.sh.rpc.fault.retry.RetryStrategyKeys;
import com.sh.rpc.fault.tolerant.TolerantStrategy;
import com.sh.rpc.fault.tolerant.TolerantStrategyKeys;
import com.sh.rpc.loadbalancer.LoadBalancerKeys;
import com.sh.rpc.serializer.SerializerKeys;
import lombok.Data;


/**
 * 默认配置
 */
@Data
public class RpcConfig {

    // 服务名称
    private String name = "sh_rpc";

    // 版本号
    private String version = "1.0";

    // 服务器端口号
    private int serverPort = 8080;

    // 服务器主机地址
    private String serverHost = "localhost";

    // 模拟调用
    private boolean mock = false;

    // 序列化器
    private String serializer = SerializerKeys.JDK;

    // 注册配置中心
    private RegistryConfig registryConfig = new RegistryConfig();

    // 负载均衡器
    private String loadBalancer = LoadBalancerKeys.ROUND_ROBIN;

    // 重试策略
    private String retryStrategy = RetryStrategyKeys.NO;

    // 容错机制
    private String tolerantStrategy = TolerantStrategyKeys.FAIL_FAST;
}
